package com.ztools.common.model.pc.sys;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ztools.common.model.pc.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.Date;
import java.util.List;

/**
 * @Author:一口香菜
 * @Date: 2023/3/1  19:10
 * @Version 1.0
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("sys_user")
public class User extends BaseModel {

    private static final long serialVersionUID = 1L;

    /**
     * 班级id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 登入名称
     */
    @TableField(value = "login_name")
    private String loginName;

    /**
     * 显示名称
     */
    @TableField(value = "show_name")
    private String showName;

    /**
     * 邮箱地址
     */
    private String email;

    /**
     * 电话号码
     */
    private String phone;

    /**
     * 登录密码
     */
    private String password;

    /**
     * 到期时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "expiration_time")
    private Date expirationTime;

    /**
     * 登录时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "login_time")
    private Date loginTime;

    /**
     * 角色列表
     */
    @TableField(exist = false)
    private List<Role> roles;

    /**
     * 权限列表
     */
    @TableField(exist = false)
    private List<Permission> permissions;

    /**
     * 登录token
     */
    @TableField(exist = false)
    private String token;

    /**
     * 查询范围天数
     */
    @TableField(value = "data_days_limit")
    private Integer dataDaysLimit;

    @TableField(exist = false)
    private Boolean rememberMe;
}
